﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 基于WPF的电缆采样数据分析系统.Views
{
    /// <summary>
    /// HistoricalDataUC.xaml 的交互逻辑
    /// </summary>
    public partial class HistoricalDataUC : UserControl
    {
        public HistoricalDataUC()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 切换查询类型
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToggleGraphic(object sender, SelectionChangedEventArgs e)
        {
            if (RecentUsedFileQuery != null &&
                UserUsedRecord != null &&
                ImportWavformRecord != null &&
                ProjectFileRecord != null &&
                ExportTaskRecord != null &&
                OperateLogRecord != null )
            {
                switch (ToggleBox.SelectedIndex)
                {
                    
                    case 0:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Visible;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Visible;
                        ImportWavformRecord.Visibility = Visibility.Collapsed;
                        ProjectFileRecord.Visibility = Visibility.Collapsed;
                        ExportTaskRecord.Visibility = Visibility.Collapsed;
                        OperateLogRecord.Visibility = Visibility.Collapsed;
                        ExportWavformRecord.Visibility = Visibility.Collapsed;

                        break;
                    case 1:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Collapsed;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Collapsed;
                        ImportWavformRecord.Visibility = Visibility.Visible;
                        ProjectFileRecord.Visibility = Visibility.Collapsed;
                        ExportTaskRecord.Visibility = Visibility.Collapsed;
                        OperateLogRecord.Visibility = Visibility.Collapsed;
                        ExportWavformRecord.Visibility = Visibility.Collapsed;

                        break;
                    case 2:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Collapsed;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Collapsed;
                        ImportWavformRecord.Visibility = Visibility.Collapsed;
                        ProjectFileRecord.Visibility = Visibility.Visible;
                        ExportTaskRecord.Visibility = Visibility.Collapsed;
                        OperateLogRecord.Visibility = Visibility.Collapsed;
                        ExportWavformRecord.Visibility = Visibility.Collapsed;

                        break;
                    case 3:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Collapsed;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Collapsed;
                        ImportWavformRecord.Visibility = Visibility.Collapsed;
                        ProjectFileRecord.Visibility = Visibility.Collapsed;
                        ExportTaskRecord.Visibility = Visibility.Visible;
                        OperateLogRecord.Visibility = Visibility.Collapsed;
                        ExportWavformRecord.Visibility = Visibility.Collapsed;

                        break;
                    case 4:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Collapsed;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Collapsed;
                        ImportWavformRecord.Visibility = Visibility.Collapsed;
                        ProjectFileRecord.Visibility = Visibility.Collapsed;
                        ExportTaskRecord.Visibility = Visibility.Collapsed;
                        OperateLogRecord.Visibility = Visibility.Visible;
                        ExportWavformRecord.Visibility = Visibility.Collapsed;

                        break;
                    case 5:
                        // 条件查询
                        RecentUsedFileQuery.Visibility = Visibility.Collapsed;

                        // 显示区域
                        UserUsedRecord.Visibility = Visibility.Collapsed;
                        ImportWavformRecord.Visibility = Visibility.Collapsed;
                        ProjectFileRecord.Visibility = Visibility.Collapsed;
                        ExportTaskRecord.Visibility = Visibility.Collapsed;
                        OperateLogRecord.Visibility = Visibility.Collapsed;
                        ExportWavformRecord.Visibility = Visibility.Visible;

                        break;
                }
            }

            
        }

        
    }
}
